import numpy as np

# 生成一个5x5的随机矩阵
Z = np.random.random((5, 5))

# 找到矩阵中的最小值和最大值
min_val = np.min(Z)
max_val = np.max(Z)

# 归一化矩阵
normalized_Z = (Z - min_val) / (max_val - min_val)

print("Original Matrix:\n", Z)
print("Normalized Matrix:\n", normalized_Z)